package com.fintech.third.service.moxie;

import com.fintech.third.model.moxie.mail.EmailBillInstallmentList;
import com.fintech.third.model.moxie.mail.EmailBillList;
import com.fintech.third.model.moxie.mail.EmailBillShoppingSheetList;
import com.fintech.third.service.moxie.task.TaskCreateReq;
import com.fintech.third.service.moxie.task.TaskCreateRsp;
import com.fintech.third.service.moxie.task.TaskStatusRsp;
import com.fintech.third.service.moxie.task.UserInput;

import retrofit2.Call;
import retrofit2.http.*;

/**
 * 信用卡账单
 */
public interface MailApi {
    /**
     * 创建任务
     *
     * @param req
     * @return
     */
    @POST("/email/v2/tasks")
    Call<TaskCreateRsp> createTask(@Body TaskCreateReq req);

    /**
     * 查询任务状态
     *
     * @param taskId
     * @return
     */
    @GET("/email/v2/tasks/{taskid}/status")
    Call<TaskStatusRsp> getTaskStatus(@Path("taskid") String taskId);

    /**
     * 输入验证码
     *
     * @param taskId
     * @param input
     * @return
     */
    @POST("/email/v2/tasks/{taskid}/input")
    Call<Void> input(@Path("taskid") String taskId, @Body UserInput input);

    /**
     * 获取账单
     *
     * @param taskId
     * @return
     */
    @GET("/email/v2/bills")
    Call<EmailBillList> getBillsByTaskId(@Query("task_id") String taskId);

    /**
     * 查询账单流水
     *
     * @param billId
     * @return
     */
    @GET("/email/v1/bills/{billid}/expense-records")
    Call<EmailBillShoppingSheetList> getBillShoppingSheets(@Path("billid") String billId, @Query("page") Integer page, @Query("size") Integer size);


    /**
     * 查询分期信息
     *
     * @param billId
     * @return
     */
    @GET("/email/v1/bills/{billid}/installment-records")
    Call<EmailBillInstallmentList> getBillInstallments(@Path("billid") String billId, @Query("page") Integer page, @Query("size") Integer size);
}
